namespace MyDay.Migrations
{
    using System;
    using System.Data.Entity.Migrations;

    public partial class CreateTodos : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "Todos",
                c => new
                {
                    ID = c.Int(nullable: false, identity: true),
                    UserId = c.Int(nullable: false),
                    Subject = c.String(),
                    DueDate = c.DateTime(),
                    IsComplete = c.Boolean()
                })
                .PrimaryKey(t => new { t.ID })
                .ForeignKey("UserProfile", t => t.UserId, cascadeDelete: true)
                .Index(t => t.UserId);
        }

        public override void Down()
        {
            DropIndex("Todos", new[] { "UserId" });
            DropForeignKey("Todos", "UserId", "UserProfile");
            DropTable("Todos");

        }
    }
}
